home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
- Compiling Version 8.5 of Icon for MS-DOS
-
- Ralph E. Griswold
- Department of Computer Science, The University of Arizona
-
-
-
- The implementation of the Icon programming language is large
- and complex [1-4]. It is, however, written almost entirely in C
- and RTL [4], a superset of C for which a translator to C is pro-
- vided. Icon is designed to be portable to a wide range of comput-
- ers and operating systems. This document concerns the compila-
- tion of Version 8.5 of Icon for MS-DOS.
-
-
- 1.__Requirements
-
- Version 8.5 of Icon runs on computers with 8086/88/x86-family
- processors. IBM hardware compatibility is not required. Either
- MS-DOS or PC-DOS, Version 3.0 or higher, is needed. Specific C
- compilers may impose more stringent requirements.
-
- Icon requires a robust and full-featured C compiler. A 16-bit
- compiler must support the large memory model. ANSI compatibility
- is important but not essential. As of the date of this document,
- Version 8.5 of Icon for MS-DOS has been successfully compiled
- with the following C compilers:
-
- Borland C++ 2.0
- Intel Code Builder 1.0
- Metaware High C 2.3
- Microsoft C 6.00 (MS-DOS and OS/2)
- Turbo C 2.0
- Zortech C++ 3.0
-
- The Version 8.5 source code contains the necessary conditional
- code for these compilers.
-
- The use of another C compiler will involve some work, since
- there is code that is conditional on the characteristics of
- specific C compilers.
-
- Icon's co-expressions require an assembly-language context
- switch. An appropriate assembler therefore is necessary to pro-
- vide this feature when building Icon entirely from the source
- code. However, object files for context switches are provided,
- where available, for persons who do not have an assembler.
-
- The source code for Icon and test programs occupies about 2MB
- of disk space. A total of about 3.5MB is needed to completely
- build and test Icon, although it is possible to get by with less
- by building incrementally.
-
-
-
-
-
- IPD183 - 1 - February 9, 1992
-
-
-
-
-
-
-
-
- 2.__Organization_of_the_Implementation
-
- The source code for Icon is organized in a hierarchy. Files
- for various components of Icon are packaged in LHarc (lzh) for-
- mat. A copy of lharc.exe is included in the distribution.
- Instructions for unloading the files are provided on the distri-
- bution diskettes.
-
- If the Icon hierarchy is rooted in \icon, the directories
- after unloading are:
- |-bin------ executable binaries
- |
- | |-borland-- Borland C++
- | |-codebldr- Intel Code Builder
- | |-highc---- Metaware High C
- |-config---|-msdos----|-microsft- Microsoft C
- | | |-turbo---- Turbo C
- | | |-zortech-- Zortech C++
- | |
- | |-os2------|-microsft- Microsoft C
- |
- | |-common--- common source
- | |-h-------- headers
- |-icon----|-src------|-icont---- Icon translator source
- | |-preproc-- pre-processor source
- | |-rtt------ run-time translator source
- | |-runtime-- Icon run-time source
- |
- |-tests----|-general--|-local---- local test results
- |-stand---- standard test results
-
-
- The distribution diskettes also contain documentation and some
- tools that may be useful in building and testing Icon. See README
- on the distribution diskettes.
-
- Source_Files
-
- The six source-code sub-directories under src contain the fol-
- lowing components of Icon:
-
- common files common to different components of Icon.
-
- h header files used by files in the other direc-
- tories.
-
- icont source code for icont, the translator and linker
- that converts an Icon source-language program into
- an icode file.
-
- preproc source code for an ANSI C pre-processor used by
- the run-time translator.
-
-
-
-
-
- IPD183 - 2 - February 9, 1992
-
-
-
-
-
-
-
-
- rtt source code for rtt, a program used in building
- iconx.
-
- runtime source code for iconx, the executor and run-time
- system for icode files.
-
- Configuration_Directories
-
- In order to simplify the process of compiling Icon under dif-
- ferent C compilers, files that are compiler-specific, including
- batch and linker files, are provided in subdirectories of the
- config directory. The MS-DOS configurations presently are:
-
- borland Borland C++
- codebldr Intel Code Builder
- highc Metaware High C
- microsft Microsoft C for MS-DOS
- turbo Turbo C
- zortech Zortech C++
-
- The use of these configuration directories is described in next
- section. Note: Some files contain path information that may need
- to be changed for a particular configuration.
-
-
- 3.__Compiling_Icon_for_an_Existing_Configuration
-
- Before starting to compile Icon, be sure your C compiler is
- properly installed and that any paths that it needs are properly
- set.
-
- Setting_up_Files
-
- The first step in the compilation process is to set up the
- files needed for compilation and linking. If you are using one
- of the C compilers mentioned above, there is a .bat file in the
- top level of the Icon hierarchy (e.g. \icon) whose name
- corresponds to the C compiler. Executing the .bat file performs
- the configuration. For example, if you want to configure Version
- 8.5 of Icon to compile under Microsoft C, just type
-
- microsft
-
- These batch files first erase files that may be left over from a
- previous configuration ("File not found" is normal at this
- point), and then they copy in compiler-specific scripts and
- source files.
-
- A file containing compiler-specific information, status, is
- also copied into the top level of the Icon hierarchy. Read this
- file before proceeding, since it may contain information needed
- to build Icon.
-
-
-
-
-
- IPD183 - 3 - February 9, 1992
-
-
-
-
-
-
-
-
- Optional_Features
-
- MS-DOS Functions: There are a few functions specially designed
- for using Icon under MS-DOS that are not part of Icon's standard
- function repertoire. The functions are described in [5]. These
- functions normally are included in the compilation process. If
- you wish to eliminate them (which decreases the size of iconx by
- a few thousand bytes), remove
-
- #define DosFncs
-
- from src\h\define.h.
-
- Large Integers: Icon has facilities for large-integer arith-
- metic, but these facilities are disabled by default in MS-DOS
- Icon because they increase the size of iconx substantially (20-
- 30KB). If you have enough RAM and wish to enable large-integer
- arithmetic, remove the following line from src\h\define.h:
-
- #define NoLargeInts
-
-
- Compilation
-
- A public-domain version of a UNIX-style make utility is pro-
- vided on the distribution diskettes. Makefiles for each subdirec-
- tory are copied into place during configuration. This make util-
- ity is different from (and more powerful) than the make utilities
- provided by present MS-DOS C compilers. If you do not want to use
- it, there is a build.bat file in each source subdirectory that
- compiles and links all files without using make.
-
- The steps in building Icon follow. Read the notes at the end
- of this section before proceeding.
-
- 1. Go to src\common and do either make or build. This pro-
- duces object files needed elsewhere.
-
- 2. Go to src\icont and do either make or build. This pro-
- duces icont.exe and copies it to bin.
-
- 3. Go to src\runtime and do either make or build. This pro-
- duces iconx.exe and copies it to bin.
-
- Notes:
-
- 1. In runtime, RTL files (with the extension .r) are
- translated by rtt to C files (with the extension .c), which
- are then compiled. An x is prepended to the name of the C
- file. For example, translation of cnv.r produces xcnv.c.
-
- 2. The steps above do not include building rtt.exe. This is
- because a working rtt.exe cannot be built under some C com-
- pilers. Instead, an rtt.exe is included with the source
-
-
-
- IPD183 - 4 - February 9, 1992
-
-
-
-
-
-
-
-
- distribution and copied to bin as the result of setting up
- Icon files. If you nonetheless wish to build rtt.exe, go to
- src\rtt and do either make or build. Preserve the distri-
- buted copy of tt.exe first, in case you run into trouble.
-
- 3. The build in src\runtime may fail if there is not enough
- available RAM when using make. This is most likely when pro-
- cessing the RTL file interp.r. If this happens, first try
- build. If that doesn't work, do the necessary steps manually
- from the command line. For interp.r first do
-
- ..\..\bin\rtt -x interp.r
-
- and then compile the resulting xinterp.c file (note the pre-
- fixed x) using the C compiler options specified in the
- Makefile or batch script.
-
- 4. On some platforms, a linking step may indicate an error
- but nonetheless produce a good .exe file. See the
- corresponding status file.
-
- As noted above, The executable files needed to run Icon are
- automatically copied to the bin directory. You may wish to move
- them to a place on your PATH.
-
-
- 4.__Configuring_Icon_for_a_New_C_Compiler
-
- If you want to build Icon under a C compiler for which there
- presently is no configuration, set up a configuration directory
- for it and copy files from a configuration that is similar to
- your C compiler. See [6] for information on modifying the new
- configuration to suit your C compiler.
-
- If you are successful in building Icon with the new compiler,
- please send the modified files to the Icon Project as described
- in Section 7 so that they can be incorporated in future releases.
-
-
- 5.__Testing
-
- A suite of test programs is provided in tests\general. The
- expected output of the test programs is in tests\general\stand;
- tests\general\local is provided for local output.
-
- The directory tests contains several files of the form
- name.lst, which consist of the names of test programs. Testing
- can be done with these files and the program runtests provided
- with the distribution. The form is:
-
- runtests name.lst > name.res
-
- where name is one of the files mentioned above. As a result,
- name.res contains a list showing differences.
-
-
-
- IPD183 - 5 - February 9, 1992
-
-
-
-
-
-
-
-
- Note: Local output may differ in some cases from the output in
- stand. This may be due to compiler or configuration differences.
- In particular, test output from 16- and 32-bit C compilers may
- differ because of different constants used in dynamic hashing. In
- the case of differences, look at the corresponding .icn file for
- a possible explanation.
-
-
- 6.__The_Implementation_Book
-
- If you are interested in the larger view of the implementation
- of Icon, or if you are interested in modifying or extending Icon,
- you may want to acquire the book on the implementation [1]. This
- book concentrates on the run-time system and covers data struc-
- tures, the virtual machine, the interpreter, the implementation
- of generators, and storage management.
-
- The implementation book corresponds to Version 6 of the Icon
- source code. There have been several changes in the source code
- between Version 6 and the present version. Supplementary documen-
- tation describing these changes is available free of charge from
- the Icon Project [2-4].
-
-
- 7.__Trouble_Reports_and_Feedback
-
- If you run into problems, contact the Icon Project:
-
- Icon Project
- Department of Computer Science
- Gould-Simpson Building
- The University of Arizona
- Tucson, AZ 85721
- U.S.A.
- (602) 621-8448 (voice)
- (602) 621-4246 (fax)
- icon-project@cs.arizona.edu (Internet)
- ... {uunet, allegra, noao}!arizona!icon-project (uucp)
-
-
- We cannot guarantee to solve your problems, but we will try.
- We also may be able to place you in contact with other persons
- who are compiling Icon and who may have similar problems.
-
- Please also let us know of any suggestions for improvements to
- the compilation process and its documentation.
-
- Acknowledgements
-
- Many persons have been involved in the implementation of Icon.
- Cheyenne Wills did most of the original work to adapt Icon for
- use under MS-DOS. Clint Jeffery, Gregg Townsend, and Ken Walker
- collaborated with the author on Version 8.5.
-
-
-
-
- IPD183 - 6 - February 9, 1992
-
-
-
-
-
-
-
-
- References
-
-
- 1. R. E. Griswold and M. T. Griswold, The Implementation of the
- Icon Programming Language, Princeton University Press, 1986.
-
- 2. R. E. Griswold, Supplementary Information for the
- Implementation of Version 8 of Icon, The Univ. of Arizona
- Icon Project Document IPD112, 1990.
-
- 3. R. E. Griswold, Supplementary Information for the
- Implementation of Version 8.5 of Icon, The Univ. of Arizona
- Icon Project Document IPD180, 1992.
-
- 4. K. Walker, An Implementation Language for Icon Run-Time
- Routines, The Univ. of Arizona Icon Project Document IPD79,
- 1989.
-
- 5. R. E. Griswold, Version 8.5 of Icon for MS-DOS, The Univ. of
- Arizona Icon Project Document IPD181, 1992.
-
- 6. R. E. Griswold, C. L. Jeffery, G. M. Townsend and K. Walker,
- Configuring the Source Code for Version 8.5 of Icon, The
- Univ. of Arizona Icon Project Document IPD182, 1992.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- IPD183 - 7 - February 9, 1992
-
-
-